package _4lists.src.SinglyLinkedList;

public class p_reserve {
    //单项链表反转
    public static void reserve(listNode head) {
        //原理:新建一个链表，遍历原来的链表，将原有链表的值一次加入到新链表的头部位置
        listNode newlist =null;
        while (head != null) {
            newlist = new listNode(head.value, newlist);
            head = head.next;
        }
    }

    public static void main(String[] args) {
        listNode l1 = new listNode(1, null);
    }
}
